<!DOCTYPE html>
<html lang="zh-cn">
	<include file="Public:header" />
<link rel="stylesheet" href="__PUBLIC__/Common/Ueditor/third-party/SyntaxHighlighter/shCore.min.css" ></script>
        <script type="text/javascript" src="__PUBLIC__/Common/Ueditor/third-party/SyntaxHighlighter/shCore.min.js" ></script>         
        <script>  
        	SyntaxHighlighter.config.clipboardSwf = 'public/clipboard.swf';
			SyntaxHighlighter.all();    
		</script>
	<body>
		<include file="Public:top" />
		<br />
		<div class="container">
			<div class="">
				<ul class="bread">
					<h4>
					<li><a href="#" class="icon-home"> 首页</a> </li>					
					<li><a href="#">文章正文</li></a>
					</h4>
				</ul>
			</div>
			<div class="line-big">
				<div class="xl12 xm8">
					<div class="line-small">
						<div class="xs12">
							<div class="a_title">{$Article.a_title}</div>
							<div class="a-write">时间：&nbsp;{$Article.create_time|date="Y-m-d H:i",###}&nbsp;&nbsp;作者：<a>{$Article.a_writer}</a>&nbsp;&nbsp;阅读：（{$Article.a_views}）</div>
							<div class="a-content">
								{$Article.a_content}
							</div>
							<div class="a-write hidden-xs">
								<eq name="Article.a_type" value="0">本文为原创，转载请注明出处:&nbsp;&nbsp;<a>{:C('siteurl')}/Home/Article/index/a_id/{$Article.a_id}.html</a>
									<br>
								</eq>
								发表自：&nbsp;{$Article.a_from}&nbsp;&nbsp;地址：{$Article.create_ip}&nbsp;&nbsp;评论：&nbsp;{$Common|count}&nbsp;&nbsp;关键词：&nbsp;{$Article['a_keyword']?$Article['a_keyword']:'暂无标签'}&nbsp;&nbsp;
							</div>
							<br />
							<div class="bdsharebuttonbox fenxiang">
								<a class="bds_more" href="#" data-cmd="more"></a>
								<a title="分享到QQ空间" class="bds_qzone" href="#" data-cmd="qzone"></a>
								<a title="分享到腾讯微博" class="bds_tqq" href="#" data-cmd="tqq"></a>
								<a title="分享到微信" class="bds_weixin" href="#" data-cmd="weixin"></a>
								<a title="分享到百度贴吧" class="bds_tieba" href="#" data-cmd="tieba"></a>
								<a title="分享到百度云收藏" class="bds_bdysc" href="#" data-cmd="bdysc"></a>
								<a title="分享到QQ好友" class="bds_sqq" href="#" data-cmd="sqq"></a>
							</div>
							<script>
								window._bd_share_config = {
									"common": {
										"bdSnsKey": {},
										"bdText": "博客的分享",
										"bdMini": "2",
										"bdMiniList": false,
										"bdPic": "http://lzkong1029.findz.cn/Public/Img/logo.png",
										"bdStyle": "1",
										"bdSize": "24"
									},
									"share": {}
								};
								with(document)
								0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];
							</script>
						</div>
						<hr />
                        <!--评论-->
                        <h2 class="bg-main text-white padding">评论区</h2>
                        <div class="container padding dynamic-box xs12">
                            <div class="comment-body">
                                <volist name="comment" id="vo">
                                    <div class="media media-x">
                                        <a class="float-left" href="#">
                                            <img src="__ROOT__{$vo.picture}" width="60" height="60" class="radius" alt="...">
                                        </a>
                                        <div class="media-body">
                                            <a class="reply-btn float-right" data-toggle="review" data-id="{$vo.id}" data-username="{$vo.username}" href="javascript:;" reply="">回复<i></i></a>
                                            <strong>{$vo.username}</strong><p>{$vo.comment}</p>
                                            <volist name="vo.child" id="v">
                                                <div class="media media-x">
                                                    <a class="float-left" href="#">
                                                        <img src="__ROOT__{$v.picture}" width="60" height="60" class="radius" alt="...">
                                                    </a>
                                                    <div class="media-body">
                                                        <a class="reply-btn float-right" data-toggle="review" data-id="{$v.id}" data-username="{$v.username}" href="javascript:;" reply="">回复<i></i></a>
                                                        <strong>{$v.username}</strong><p>{$v.comment}</p>
                                                    </div>
                                                    <volist name="v.child" id="v3">
                                                        <div class="media media-x">
                                                            <a class="float-left" href="#">
                                                                <img src="__ROOT__{$v3.picture}" width="60" height="60" class="radius" alt="...">
                                                            </a>
                                                            <div class="media-body">
                                                                <!--<a class="reply-btn float-right" data-toggle="review" data-id="{$v3.id}" data-username="{$v3.username}" href="javascript:;" reply="">回复<i></i></a>-->
                                                                <strong>{$v3.username}</strong><p>{$v3.comment}</p>
                                                            </div>
                                                        </div>
                                                    </volist>
                                                </div>
                                            </volist>
                                        </div>
                                    </div>
                                </volist>
                            </div>

                            <div class="comment">
                                <form class="clearfix comment-form" action="{:U('Article/comment')}" method="post">
                                    <input type="hidden" name="cid" value="{$Article.a_id}">
                                    <input type="hidden" name="uid" value="{$Think.session.uid}" />
                                    <input type="hidden" name="review_id" value="0">
                                    <div class="form-group">
                                        <textarea class="input margin-top" rows="4" placeholder="写下你的评论" name="content"></textarea>
                                    </div>
                                    <div class="clearfix">
                                        <a href="javascript:;" data-toggle="face"><i class="iconfont icon-biaoqing"></i></a>
                                        <button type="submit" class="button bg-main text-big" data-loading-text="请稍后...">回复</button>
                                        <a class="margin-left" data-toggle="close" href="javascript:;">取消</a>
                                    </div>
                                </form>
                            </div>

                        </div>
                        <!--评论结束-->
						<div class="a-up">
							<p>上一篇：
								<if condition="$down['a_id'] eq 0">
									<a title='没有了'>&nbsp;没有了</a>
									<else />
									<a title='{$down.a_title}' href="{:U('Article/index',array('a_id'=>$down['a_id']))}">{$down.a_title}</a>
								</if>
							</p>
						</div>
						<div class="a-down">
							<p>下一篇：
								<if condition="$up['a_id'] eq 0">
									<a title='没有了'>&nbsp;没有了</a>
									<else />
									<a title='{$up.a_title}' href="{:U('Article/index',array('a_id'=>$up['a_id']))}">{$up.a_title}</a>
								</if>
							</p>
						</div>
						<div class="pages" style=" text-align: right;">
							{$page}
						</div>
					</div>
					<br />
					<br />
					<br />
				</div>
				<include file="Public:right" />
			</div>
		</div>
		<include file="Public:footer" />
        <script type="text/javascript">
            $(function() {
                //插入回复表单
                $(".dynamic-box").on('click', '[data-toggle="review"]', function(event) {
                    var $form = $(".dynamic-box").find('.comment-form');
                    var $textarea = $form.find("[name='content']");
                    $form.appendTo($(this).next().next());

                    $form.find(':hidden[name=review_id]').val($(this).data('id'));
                    //对回复回复的处理
                    if ($(this).data('username')!=='') {
                        $textarea.val('回复 @' + $(this).data('username') + ' : ');
                    } else {
                        $textarea.val('');
                    }
                    moveEnd($textarea.get(0));
                    event.stopPropagation();
                });

                //点击评论框以外的地方，重置评论表单
                /*$(document).click(function() {
                 // alert(1111111111);
                 var $form = $(".dynamic-box").find('.comment-form');
                 if ($form.length > 0) {
                 if ($form.find(':hidden[name=review_id]').val() !== '0') {
                 $form.parents(".dynamic-box").find(".comment-form").before($form);
                 $form.find(':hidden[name=review_id]').val(0);
                 $form.find('textarea').val('');
                 }
                 }
                 });*/
                //关闭
                $(".dynamic-box").on('click', "[data-toggle='close']", function(event) {
                    var $form = $(".dynamic-box").find('.comment-form');
                    if ($form.length > 0) {
                        if ($form.find(':hidden[name=review_id]').val() !== '0') {
                            $form.parents(".dynamic-box").find(".comment-form").before($form);
                            $form.find(':hidden[name=review_id]').val(0);
                            $form.find('textarea').val('');
                        }
                    }
                    $(this).parents('.comment-form').remove();
                    $form.appendTo($('.comment'));
                    event.stopPropagation();
                });

                $(".dynamic-box").on('click', 'textarea', function(event) {
                    event.stopPropagation();
                });

            });
        </script>
	</body>

</html>